<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>手机快速登录或注册</title>
	<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<link rel="stylesheet" href="__STATIC__/css/base.css">
	<link rel="stylesheet" href="__STATIC__/icon/icon.css">
	<script type="text/javascript" src="__STATIC__/js/core/jquery.min.js"></script>
	<script type="text/javascript" src="__STATIC__/layer/layer.js"></script>
</head>
<body>


{qb:hy name="wap_phone_001" where="index_style/default/index/login/wap/phone" val="datas" type="labelmodel"}
	{$datas}
{/qb:hy}

<script type="text/javascript">
//做风格的时候,这里的代码可以直接复制即可
var qq_login_url = "{:purl('login/qq/index')}?fromurl={$fromurl}";
var wx_login_url  = "{:purl('weixin/login/index')}?fromurl={$fromurl}";
var ck_qqlogin_url = "{:purl('login/qq/app',[],'index')}?";
var ck_wxlogin_url = "{:iurl('index/wxapp.login/web_login_check')}?";
var jump_from_url = "{$fromurl}";
var app_login_type = "{$webdb.wxopen_appkey?2:1}";
var app_login_url = "{:iurl('index/wxapp.login/wxopen')}";
var xcx_gh_id = "{$webdb['P__h5app']['wxapp_ghid']}";
</script>
<script type="text/javascript" src="__STATIC__/js/login.js?s"></script>


<script type="text/javascript">
function get_code_num(type){
	var to='';
	var obj = $(".mui-input-group input[name='"+type+"']");

	to = obj.val();
	if(to==''){
		obj.focus();
		layer.msg('请先输入手机号码');
		return false;
	}

	layer.msg('请稍候,系统正在发送手机验证码!',{time:3000});
	$.get("{:urls('login/get_phone_num')}?phone=" + to + '&'+Math.random(),function(res){
		layer.close();
		if(res.code==0){
			layer.alert('验证码已成功发出,请耐心等候,注意查收!');
			//objs.removeClass('error');
		}else{
			layer.alert(res.msg);
			//objs.addClass('error');
		}			
	});
}

function check_num(objs){
	var vals = objs.val();
	var index = layer.load(1,{shade: [0.7, '#393D49']}, {shadeClose: true}); //0代表加载的风格，支持0-2
	$.get("{:urls('login/check_phone_num')}?num=" + vals + '&'+Math.random(),function(res){
		layer.closeAll();
		if(res.code==0){
			objs.removeClass('error');
			if(res.data.type=='login'){
				layer.msg('登录成功,欢迎' + res.data.username + '您回来');
				window.location.href = "{:urldecode($fromurl)}";
			}else if(res.data.type=='reg'){  //提示注册一个新帐号
				$(".check_btn").hide();
				layer.alert('验证成功,请为新帐号设置一个登录名');
				$(".atc_username").show();				
				//$(".atc_username input").val(res.data.username);
				$(".reg_btn").show();	
			}else{
				layer.alert(res.msg);
			}
		}else{
			layer.msg(res.msg);
			objs.addClass('error');
		}			
	});
}

function checkinput(objs,type){
	var vals=objs.val();
	$.get("{:urls('reg/check')}?"+type+"="+vals+'&'+Math.random(),function(d){
		if(d=='ok'){
			objs.removeClass('error');
		}else{
			layer.msg(d);
			//objs.focus();
			objs.addClass('error');
		}			
	});
}

</script>
</div>
</body>
</html>